<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="UTF-8">
	<title>积分充值</title>
	<link rel="stylesheet" href="/js/plugin/layui-v2.3.0/layui/css/layui.css">
	<link rel="stylesheet" href="/css/reset.css">
	<link rel="stylesheet" href="/css/index.css">
	<link rel="stylesheet" href="/css/index_team.css">
	<script src='/js/jquery-2.1.1.min.js'></script>
    <script src="/js/plugin/layui-v2.3.0/layui/layui.js"></script>
    <script src="/js/common.js"></script>
</head>
<style>
::-webkit-scrollbar-thumb {
  border-radius: 10px;
  height:50%;
}
::-webkit-scrollbar{width:6px;}
	body{
		overflow-y: scroll;
}
.my-tab .layui-tab-title{
	padding:0 30px;
}
.layui-form-label{
	width: 92px;
	text-align: left;
}
.layui-input-block{
	margin-left: 122px;
}
</style>
<body>
	<div class="">
		<div class="layui-tab layui-tab-brief my-tab" lay-filter="docDemoTabBrief">
		  <ul class="layui-tab-title mag-top-20">
		    <li class="layui-this">充值</li>
		    <li>赠送</li>
		    <li>扣除</li>
		  </ul>
		  <div class="layui-tab-content" style="padding-right: 30px; padding-left: 15px;">
		  		<div class="layui-tab-item layui-show">
		  			<form class="layui-form" id="defaultForm" th:action="@{/app/customerIntegral/save}" th:method="post" lay-filter="employee-form">
							<input type="hidden" name="fkTeam" id="fkTeam" th:value="${id}"/>
							<input type="hidden" name="type" id="type" th:value="1"/>
							<div class="layui-form-item">
							    <label class="layui-form-label"><span class="must-fill">*</span>充值积分数量</label>
							    <div class="layui-input-block">
							      	<input type="text" name="baseRecharge" onkeyup="calculation()" id="baseRecharge" lay-verify="baseRecharge" placeholder="" autocomplete="off" class="layui-input">
							    </div>
							</div>
							<div class="layui-form-item">
							    <label class="layui-form-label"><span class="must-fill">*</span>收款金额</label>
							    <div class="layui-input-block">
							      	<input type="text" name="gatherMoney" id="gatherMoney" required  lay-verify="gatherMoney" placeholder="" autocomplete="off" class="layui-input">
							    </div>
							</div>
							<div class="layui-form-item">
							    <label class="layui-form-label"><span class="must-fill">*</span>支付方式</label>
							    <div class="layui-input-block">
							      	<select id="paymentMethod" name="paymentMethod">
								      	<option value="cash">现金支付</option>
								      	<option value="point">积分支付</option>
								      	<option value="manually">人工核销</option>
								      	<option value="pos">pos支付</option>
								      	<option value="union_pay">银联支付</option>
								      	<option value="wechat_offline">微信（线下）</option>
								      	<option value="alipay_offline">支付宝（线下）</option>
								      	<option value="balance">余额付款</option>
								      	<option value="credit">会员资源支付</option>
								      	<option value="other">其他</option>
							      	</select>
							    </div>
							</div>
							<div class="layui-form-item">
							    <label class="layui-form-label"><span class="must-fill">*</span>已付款</label>
							    <div class="layui-input-block">
							      	 <input lay-filter="already" lay-verify="already" name="already" title="是" type="radio" value="0" checked>
									 <input lay-filter="already" name="already" title="否 " type="radio" value="1">
							    </div>
							</div>
							
							<div class="layui-form-item">
							    <label class="layui-form-label">备注</label>
							    <div class="layui-input-block">
							      	<textarea name="remarks" placeholder="请输入内容" class="layui-textarea">积分充值</textarea>
							    </div>
							</div>
							<div class="layui-form-item" style="padding-left:15px">
							      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formEmployee" id="submit-btn">确定</button>
							</div>
						
					</form>	
		  		</div>
			    <div class="layui-tab-item">
			    	<form class="layui-form" id="defaultForm1" th:action="@{/app/customerIntegral/save}" th:method="post" lay-filter="employee-form">
						<input type="hidden" name="fkTeam" id="fkTeam" th:value="${id}"/>
						<input type="hidden" name="type" id="type" th:value="2"/>
						<div class="layui-form-item">
						    <label class="layui-form-label"><span class="must-fill">*</span>赠送数量</label>
						    <div class="layui-input-block">
						      	<input type="text" name="giftRecharge" id="giftRecharge" lay-verify="giftRecharge" placeholder="" autocomplete="off" class="layui-input">
						    </div>
						</div>
						<div class="layui-form-item">
						    <label class="layui-form-label">备注</label>
						    <div class="layui-input-block">
						      	<textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
						    </div>
						</div>
						<div class="layui-form-item" style="padding-left:15px">
						      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formEmployee1" id="submit-btn">确定</button>
						</div>
						
					</form>	

			    </div>
			    <div class="layui-tab-item">
			    	<form class="layui-form" id="defaultForm2" th:action="@{/app/customerIntegral/save}" th:method="post" lay-filter="employee-form">
						<input type="hidden" name="fkTeam" id="fkTeam" th:value="${id}"/>
			    		<input type="hidden" name="type" id="type" th:value="3"/>
						<div class="layui-form-item">
						    <label class="layui-form-label"><span class="must-fill">*</span>扣除数量</label>
						    <div class="layui-input-block">
						      	<input type="text" name="giftRecharge" id="giftRecharge"  lay-verify="del" placeholder="" autocomplete="off" class="layui-input">
						    </div>
						</div>
						<div class="layui-form-item">
						    <label class="layui-form-label">备注</label>
						    <div class="layui-input-block">
						      	<textarea name="remarks" placeholder="请输入内容" class="layui-textarea"></textarea>
						    </div>
						</div>
						<div class="layui-form-item" style="padding-left:15px">
						      <button class="layui-btn layui-btn-normal btn-bg" lay-submit lay-filter="formEmployee2" id="submit-btn">确定</button>
						</div>	
					</form>	
			    </div>
		  </div>
		</div>      
	</div>
	
</body>
<script>
	$(function(){
		layui.use(['element','form'] ,function(){
		  var element = layui.element,form=layui.form;
			form.verify({
				integralNum: function(value, item){ //value：表单的值、item：表单的DOM对象
					var reg="^[0-9]*[1-9][0-9]*$";
					  if(value==""){
						  return '请输入充值数量';
					}else if(!reg.test(value)){
						  return '请输入正整数';
					}
			    },
			    gatherMoney: function(value, item){
					if(value==""){
					  return '请输入充值数量';
					}
			    }
			}); 	
		  
			//监听提交
			  form.on('submit(formEmployee)', function(data){
				  $.post($("#defaultForm").attr('action'), data.field, function(result) {
						window.parent.layer.msg(result.msg);
						closeLayer();
					}, 'json');
					return false;
			  });
			//监听提交
			  form.on('submit(formEmployee1)', function(data){
				  $.post($("#defaultForm1").attr('action'), data.field, function(result) {
						window.parent.layer.msg(result.msg);
						closeLayer();
					}, 'json');
					return false;
			  });
			//监听提交
			  form.on('submit(formEmployee2)', function(data){
				  $.post($("#defaultForm2").attr('action'), data.field, function(result) {
						window.parent.layer.msg(result.msg);
						closeLayer();
					}, 'json');
					return false;
			  });
			
		});
		
	})
function calculation(){
	var baseRecharge=$("#baseRecharge").val();
	$("#gatherMoney").val(baseRecharge);
}
</script>
</html>